package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsCheckNoteVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 盘点记录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-02
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsCheckNote extends BaseEntity<AssetsCheckNoteVO> {

    private static final long serialVersionUID = 1L;
    public AssetsCheckNote(AssetsCheckNoteVO vo){
        this.noteId = vo.getNoteId();
        this.planId = vo.getPlanId();
        this.checkType = vo.getCheckType();
        this.deptId = vo.getDeptId();
        this.areaId = vo.getAreaId();
        this.assetsId = vo.getAssetsId();
        this.checkState = vo.getCheckState();
        this.checkDescribe = vo.getCheckDescribe();
        this.photoList = vo.getPhotoList();
        this.checkTime = vo.getCheckTime();
        this.checkUserId = vo.getCheckUserId();
        this.checkUser = vo.getCheckUser();
        this.reviewState = vo.getReviewState();
        this.reviewTime = vo.getReviewTime();
        this.reviewUserId = vo.getReviewUserId();
        this.reviewUser = vo.getReviewUser();
        this.pictureUrl = vo.getPictureUrl();
        this.lableType = vo.getLableType();
        this.checkPictureUrl = vo.getCheckPictureUrl();
        this.summaryNumber = vo.getSummaryNumber();
        this.assetsName = vo.getAssetsName();
        this.areaName = vo.getAreaName();
        this.deptName = vo.getDeptName();
        this.assetsState = vo.getAssetsState();
        this.categoryId = vo.getCategoryId();

    }

    @Override
    public AssetsCheckNoteVO convertToVO(){
        return new AssetsCheckNoteVO(this);
    }


    /**
     * 盘点明细ID
     */
    @TableId(value = "note_id", type = IdType.AUTO)
    private Integer noteId;

    /**
     * 计划ID
     */
    private String planId;

    /**
     * 1手工盘点 2RFID扫描 3二维码扫描
     */
    private Integer checkType;

    /**
     * 资产使用部门
     */
    private String deptId;

    /**
     * 资产所属区域
     */
    private String areaId;

    /**
     * 资产ID
     */
    private String assetsId;

    /**
     * 资产类别Id
     */
    private String categoryId;

    /**
     * 标签材质
     */
    private Integer lableType;

    /**
     * 资产盘点状态
     */
    private Integer checkState;

    /**
     * 盘点描述
     */
    private String checkDescribe;

    /**
     * 盘点照片列表
     */
    private String photoList;

    /**
     * 盘点时间
     */
    private String checkTime;

    /**
     * 盘点人ID
     */
    private String checkUserId;

    /**
     * 盘点人
     */
    private String checkUser;

    /**
     * 审核状态(0待审核 1审核通过 2审核不通过)
     */
    private Integer reviewState;

    /**
     * 汇总数量值
     */
    private Integer summaryNumber;

    /**
     * 审核时间
     */
    private Date reviewTime;

    /**
     * 审核人ID
     */
    private String reviewUserId;

    /**
     * 审核人
     */
    private String reviewUser;

    @TableField(exist = false)
    private List pictureUrl;

    @TableField(exist = false)
    private List checkPictureUrl;

    @TableField(exist = false)
    private String assetsName;

    @TableField(exist = false)
    private String areaName;

    @TableField(exist = false)
    private String deptName;

    @TableField(exist = false)
    private String assetsState;


    public enum ColName {
        lable_type,note_id, plan_id, check_type, dept_id, area_id, assets_id, check_state, check_describe, photo_list, check_time, check_user_id, check_user, review_state, review_time, review_user_id, review_user,
    }
}
